<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__CSS__/layui.css">
    <link rel="stylesheet" href="__CSS__/view.css"/>
    <link rel="icon" href="/favicon.ico">
    <title>银行卡信息</title>
</head>
<body class="layui-view-body">
    <div class="layui-content">
        <div class="layui-page-header">
            <div class="pagewrap">
                <span class="layui-breadcrumb">
                  <a href="">首页</a>
                  <a href="">提现管理</a>
                  <a><cite>提现卡管理</cite></a>
                </span>
            </div>
        </div>
        <div class="layui-row">
          <a id="addcrds" class="layui-btn layui-btn-blue">新增银行卡</a>
            {volist name="data" id="vs"}
              <div class="layui-card">
                  <div class="layui-card-header">银行卡信息
                    <a style="float:right" onclick="bankdel({$vs['card_id']})" class="layui-btn layui-btn-danger">删除</a>
                    <a onclick="upopen({$vs['card_id']})" style="float:right;margin-right:0.5rem" class="layui-btn">修改</a>
                  </div>

                  <form class="layui-form layui-card-body" id="doform">
                    <div class="layui-form-item">
                      <label class="layui-form-label">开户人</label>
                      <div class="layui-input-block">
                        <input type="text" name="card_name" required="" lay-verify="required" placeholder="" autocomplete="off" id="card_name" value="{$vs['card_name']}" class="layui-input">
                      </div>
                    </div>
                    <div class="layui-form-item">
                      <label class="layui-form-label">所属银行</label>
                      <div class="layui-input-block">
                        <input type="text" name="card_bank_id" required="" lay-verify="required" placeholder="" autocomplete="off" value="{$vs['card_bank_id']}" id="card_bank_id" class="layui-input">
                      </div>
                    </div>
                    <div class="layui-form-item">
                      <label class="layui-form-label">银行卡号</label>
                      <div class="layui-input-block">
                        <input type="text" name="card_no" required="" lay-verify="required" placeholder="请输入卡号" autocomplete="off" value="{$vs['card_no']}" id="card_no" class="layui-input">
                      </div>
                    </div>
                    <div class="layui-form-item">
                      <label class="layui-form-label">预留电话</label>
                      <div class="layui-input-block">
                        <input type="text" name="card_phone" required="" lay-verify="required" placeholder="" autocomplete="off" value="{$vs['card_phone']}" id="card_phone" class="layui-input">
                      </div>
                    </div>
                    <div class="layui-form-item">
                      <label class="layui-form-label">开户省</label>
                      <div class="layui-input-inline">
                        <input type="text" name="card_province" required="" value="{$vs['card_province']}" id="card_province" lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
                      </div>
                      <label class="layui-form-label">开户市</label>
                      <div class="layui-input-inline">
                        <input type="text" name="card_city" required="" value="{$vs['card_city']}" id="card_city" lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
                      </div>
                    </div>
                    
                    <!-- <div class="layui-form-item">
                      <div class="layui-input-block">
                        <a id="formDemo" class="layui-btn layui-btn-blue" lay-submit="" lay-filter="formDemo">立即提交</a>
                      </div>
                    </div> -->
                  </form>  
              </div>
            {/volist}
        </div>
    </div>
    <script src="__JS__/layui.all.js"></script>
    <script src="__JS__/jquery.min.js"></script>

    <script>

        // 修改银行卡
        function upopen(cid){
          
            layer.open({
              type: 2 //Page层类型
              ,area: ['400px', '500px']
              ,title: '更改银行卡信息'
              ,shade: 0.5 //遮罩透明度
              ,maxmin: false //允许全屏最小化
              ,anim: 1 //0-6的动画形式，-1不开启
              ,content: "{:Url('Agent/Withdrwal/crdcags')}"+'?cid='+cid
            });
        }

        // 删除银行卡
        function bankdel(cid){

          layer.confirm('是否确定删除该银行卡', {
            btn: ['确认','取消'] //按钮
          }, function(){
              var urls = "{:Url('Agent/Withdrwal/crddel')}";
              $.get(urls, {cid:cid}, function(e){
                  if(e.error == '1'){
                      layer.msg(e.msg);
                      return false;
                  }else if(e.error == '0'){
                      layer.msg(e.msg);
                      setTimeout(function(){
                          location.reload();
                      },1500) 
                  }
              });
          }, function(){});
            
        }

        // 新增银行卡
        $('#addcrds').click(function(){
            layer.open({
              type: 2 //Page层类型
              ,area: ['400px', '500px']
              ,title: '新增银行卡'
              ,shade: 0.5 //遮罩透明度
              ,maxmin: false //允许全屏最小化
              ,anim: 1 //0-6的动画形式，-1不开启
              ,content: "{:Url('Agent/Withdrwal/crdsadd')}"
            });
        });

    </script>

</body></html>